//
//  AFFVCSegmented.h
//  AnyfishApp
//
//  Created by Anyfish-zhuangbo on 15/9/22.
//  Copyright © 2015年 Anyfish. All rights reserved.
//

#import "BaseViewController.h"
#import "AFFSearchDisplay.h"

typedef NS_ENUM(char, AFFSegmentlineType){
    ESegmentline_short, ///< 和文字长度一样
    ESegmentline_long   ///< 长度均分
} ;

@protocol AFFVCSegmentedDelegate <NSObject>

@optional
- (void)segmentDidChangeToIndex:(NSInteger)index;
- (void)segmentWillChangeToIndex:(NSInteger)index;

@end

@interface AFFVCSegmented : BaseViewController

@property(nonatomic, strong) UIColor *color_seg_nor;            ///< 默认颜色，默认值：color_999999
@property(nonatomic, strong) UIColor *color_seg_sel;            ///< 选中颜色是，默认：color_16a8ef
@property(nonatomic ,strong) NSArray *arrSegment;               ///< 标签标题的数组 ---  最多有4个标签哈
@property(nonatomic ,strong) UIView * segmentScr; ///< 标签的 UIView ，最多4个标签
@property(nonatomic ,strong) UIScrollView * segmentContentScr;     ///< 承载 tableView 的 scrollView
@property(nonatomic , assign) AFFSegmentlineType type;          ///< 文字底部线条的类型，默认为填满分区 如果需要设置文字长短 先赋值arrSegment
@property (nonatomic, assign) id<AFFVCSegmentedDelegate> delegateSeg;  
@property (nonatomic ,assign) NSInteger currentIndex; ///< 当前index
@property (nonatomic, assign) CGFloat marginBottom;    ///< 距离底部的高度，部分界面子类需要底部增加浮动按钮等的处理；默认是0

// 页面加载控制
@property (nonatomic, strong) NSMutableArray *mArrSubPage;    ///< 每页view列表
@property (nonatomic, readonly) BOOL isLoading;    ///< 是否有subView正在加载


- (void)removeSupper;


- (void)scrollViewDidScroll:(UIScrollView *)scrollView;


/**
 * 滑动到某个索引
 */
- (void)scrollToIndex:(NSInteger)index;



@end
